package com.syc.sss.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class LoginController {
    @RequestMapping("/login")
    public String login(){
        return "login";
    }

    @RequestMapping("/doLogin")
    public String doLogin(HttpServletRequest request, String username, String password){
        request.getSession().setAttribute("username", username);
        request.getSession().setAttribute("password", password);
        return "redirect:query";
    }
}
